﻿using NHibernate;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Shape.Mvp.Persistence.Conversations.Hibernate
{
	public class HibernateConversationFactory : IConversationFactory
	{
		private readonly ISessionFactory _sessionFactory;

		public HibernateConversationFactory(ISessionFactory sessionFactory)
		{
			_sessionFactory = sessionFactory;
		}

		public IConversation CreateConversation()
		{
			return new HibernateConversation(_sessionFactory);
		}

		public IConversation CreateConversation(string id)
		{
			return new HibernateConversation(_sessionFactory, id);
		}
	}
}
